1. Field of the Invention
The present invention relates to a computer program product, system, and method for building a metadata index from source metadata records when creating a target volume for subsequent metadata access from the target volume.
2. Description of the Related Art
In certain computing environments, multiple host systems may update data sets in volumes configured in a storage system, such as interconnected storage devices, e.g., a Direct Access Storage Device (DASD), Redundant Array of Independent Disks (RAID), Just a Bunch of Disks (JBOD), etc. Data sets are comprised of extents, which may comprise any grouping of tracks and data storage units. The Z/OS® operating system from International Business Machines Corporation (“IBM”) has a Volume Table of Contents (VTOC) to provide information about data sets configured in the volume, where the VTOC indicates the location of tracks, extents, and data sets for a volume in storage. For System Managed Storage (SMS), the z/OS operating system provides a VSAM volume data set (VVDS) having records providing metadata for VSAM and non-VSAM data sets. The VTOC has information on non-VSAM and VSAM data sets in the volume. The records in the VVDS comprise a VSAM Volume Record (VVR) providing metadata for VSAM data sets and non-VSAM Volume Records (NVR) providing metadata for non-VSAM or non-indexed data sets. (Z/OS is a registered trademark of IBM in the United States and other countries)
Programs that process data sets obtain information from these VVDS records to determine how the data sets should be handled. Since the VVDS is not indexed, a catalog has information about the location of the VVDS record for the data set. A catalog stores logical information about a dataset and the VVDS stores physical information for a data set, such as the physical track address in storage. The catalog enables fast access to a VVDS record. Programs that require VVDS records use a service that accesses the catalog to determine the location of the required VVDS record.
When copying a source volume to a target volume, if the target volume has the same VOLSER, or volume serial number, as the source volume, then the target volume would have to be taken offline. To allow the target volume to remain online, the target volume would have to have a different VOLSER than the source VOLSER. A conditioned volume is a copy of a volume that retains its original target VOLSER.
In the IBM Data Facility Storage Management Subsystem (DFSMS), a conditioned volume is a target volume that has the same named VTOC and VVDS as the source, but the volume name (VOLSER) is different, allowing the target volume to be online with the source volume. A conditioned target volume is created with a DFSMSdss COPY FULL called with the DUMPCONDITIONING keyword. A COPY FULL command would copy the volume label which is part of track zero resulting in the target volume having the same VOLSER as the source volume. However, use of the DUMPCONDITIONING keyword enables the target volume to remain online with a different target VOLSER. However, the VTOC, VTOC Index and VVDS have the same name as they did on the source volume.
FIG. 1 illustrates a target volume 100 comprising a conditioned copy of source volume 102. The source volume 102 has a different volume name (“VOL001”) than the target volume 100 (“VOL002”). However, the source VTOC name 104 has a same name as the copied target VTOC 106 and the source VVDS name 108 has a same name as the target VVDS 110. With the conditioned target volume, the catalog cannot be used to access the VVDS records because the target VOLSER name is different from the source VVDS name. A process that wants to access a record in the target VVDS 110 for a data set in the target volume needs to scan the entire content of the target VVDS 110 to locate the VVDS record for the target data set to access.